// 菜单节点
var zNodes =[
    {id:1, name:"留学问答管理", open:true,icon:"././images/behind/menu_point.png"},
	{id:101, pId:1, name:"留学问答查询", open:true,icon:"././images/behind/menu_point.png",target:"mainFrame",url:"initQaFind.html"},
	{id:102, pId:1, name:"增加留学问答", open:true,icon:"././images/behind/menu_point.png",target:"mainFrame",url:"initQaAdd.html"},
    {id:2, name:"新闻管理",open:true,icon:"././images/behind/menu_point.png"},
    {id:201, pId:2, name:"新闻查询", open:true,icon:"././images/behind/menu_point.png",target:"mainFrame",url:"initNewsFind.html"},
	{id:202, pId:2, name:"增加新闻", open:true,icon:"././images/behind/menu_point.png",target:"mainFrame",url:"initNewsAdd.html"},
    {id:3, name:"用户管理",open:true,icon:"././images/behind/menu_point.png"},
    {id:301, pId:3, name:"用户查询", open:true,target:"mainFrame",url:"initAdminFind.html",icon:"././images/behind/menu_point.png"},
	{id:302, pId:3, name:"增加用户", open:true,target:"mainFrame",url:"initAdminAdd.html",icon:"././images/behind/menu_point.png"},
    {id:4, name:"学生基本情况管理",open:true,icon:"././images/behind/menu_point.png"},
    {id:401, pId:4, name:"学生资料查询", open:true,target:"mainFrame",url:"initStuInfoFind.html",icon:"././images/behind/menu_point.png"},
    {id:402, pId:4, name:"学生情况录入", open:true,target:"mainFrame",url:"initStuInfoAdd.html",icon:"././images/behind/menu_point.png"},
    {id:403, pId:4, name:"学生资料上传", open:true,target:"mainFrame",url:"initStuDetailFind.html",icon:"././images/behind/menu_point.png"},
    {id:5, name:"会员管理",open:true,icon:"././images/behind/menu_point.png"},
    {id:501, pId:5, name:"会员查询", open:true,target:"mainFrame",url:"initUserFind.html",icon:"././images/behind/menu_point.png"},
    {id:502, pId:5, name:"会员录入", open:true,target:"mainFrame",url:"initUserAdd.html",icon:"././images/behind/menu_point.png"},
    {id:6, name:"在线评估预览",open:true,url:"initEstFind.html",target:"mainFrame",icon:"././images/behind/menu_point.png"}
];

// 树形菜单配置
var setting = {
	view: {
		dblClickExpand: false,
		showLine: true,
		selectedMulti: false,
		expandSpeed: ($.browser.msie && parseInt($.browser.version)<=6)?"":"fast"
	},
	data: {
		simpleData: {
			enable:true,
			idKey: "id",
			pIdKey: "pId",
			rootPId: ""
		}
	},
	callback:{
		onClick: zTreeOnClick
	}
};

/** 页面加载 */
$(document).ready(function(){
	// 加载属性菜单
	var ztree = $.fn.zTree.init($("#ztree_menu"), setting, zNodes);
});

/** 控制iframe返回上一页 */
function mainFrameGoBack(){
	window.frames["mainFrame"].document.history.go(-1);
}

/** 修改标题 */
function zTreeOnClick(event, treeId, treeNode, clickFlag){
	if (treeNode.url != undefined && treeNode.url != null) {
		$("#layout_center").panel("setTitle",treeNode.name);
	}
}
